//控件设置的基础配置

// import bussinessControl from './bussiness-setup';
// import contractControl from './contract-setup';
// import invoiceControl from './invoice-setup';
import { baseControl, baseControlField } from './set-up-attribute/base-setup';
import {
  organizationControl,
  organizationControlField
} from './set-up-attribute/organization-setup';
import {
  businessControl,
  businessControlField
} from './set-up-attribute/business-setup';
import {
  positonControl,
  positonControlField
} from './set-up-attribute/position-setup';
import {
  humanControl,
  humanControlField
} from './set-up-attribute/human-setup';

//tab配置
export interface TtabItem {
  tabName: string; //tab的名称
  code: string; //tab的唯一code
  componentCodeList: string[]; //tab下的控件code列表，根据这个渲染tab下的控件
}
export const tabList: TtabItem[] = [
  {
    tabName: '上传的全部控件',
    code: 'allComponent',
    componentCodeList: [
      ...baseControlField,
      ...organizationControlField,
      ...businessControlField,
      ...positonControlField,
      ...humanControlField
    ]
  },
  {
    tabName: '基础控件',
    code: 'baseComponent',
    componentCodeList: [...baseControlField]
  },
  {
    tabName: '全部业务控件',
    code: 'businessComponent',
    componentCodeList: [
      ...organizationControlField,
      ...businessControlField,
      ...positonControlField,
      ...humanControlField
    ]
  },
  {
    tabName: '组织控件',
    code: 'organizationComponent',
    componentCodeList: [...organizationControlField]
  },
  {
    tabName: '商业控件',
    code: 'businessComponent',
    componentCodeList: [...organizationControlField]
  },
  {
    tabName: '职位控件',
    code: 'positionComponent',
    componentCodeList: [...positonControlField]
  },
  {
    tabName: '人员控件',
    code: 'humanComponent',
    componentCodeList: [...humanControlField]
  }
];

//控件配置
export interface TcomponentItem {
  componentName: string; //控件的名称
  componentType: string; //控件的类型
  code: string; //控件的唯一code
  fieldName?: string; // 具体控件的名称
  showFieldList: string[]; //该控件可修改的props字段
  icon: string; //控件的icon
  props: any; //对象 props的默认值
}
export const componentList: TcomponentItem[] = [
  ...baseControl,
  ...organizationControl,
  ...businessControl,
  ...positonControl,
  ...humanControl
];
